﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CountOccurances_;

namespace _4.UnitTest_CountOccurances
{
    [TestClass]
    public class UnitTest_CountOccurances
    {
        [TestMethod]
        public void TestMethod1()
        {
            int[] array = { 1, 6, 8, 4, 3, 4, 5, 6, 8, 4, 12 };
            int res = CountOccurances_.CountOccurances_.CountOccurances(4, array);
            Assert.AreEqual(3, res);
        }
        [TestMethod]
        public void TestMethod2()
        {
            int[] array = { 1, 1, 1, 4, 3, 4, 5, 6, 8, 4, 12 };
            int res = CountOccurances_.CountOccurances_.CountOccurances(1, array);
            Assert.AreEqual(3, res);
        }
        [TestMethod]
        public void TestMethod3()
        {
            int[] array = { 1, 6, 8, 4, 3, 4, 5, 6, 8, 4, 12 };
            int res = CountOccurances_.CountOccurances_.CountOccurances(4, array);
            Assert.AreEqual(3, res);
        }
        [TestMethod]
        public void TestMethod4()
        {
            int[] array = { 1, 6, 8, 4, 3, 4, 5, 6, 8, 4, 12 };
            int res = CountOccurances_.CountOccurances_.CountOccurances(5, array);
            Assert.AreEqual(1, res);
        }
        [TestMethod]
        public void TestMethod5()
        {
            int[] array = { 1, 6, 6, 6, 3, 4, 5, 0, 8, 4, 12 };
            int res = CountOccurances_.CountOccurances_.CountOccurances(6, array);
            Assert.AreEqual(3, res);
        }
        [TestMethod]
        public void TestMethod6()
        {
            int[] array = { 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12 };
            int res = CountOccurances_.CountOccurances_.CountOccurances(12, array);
            Assert.AreEqual(array.Length, res);
        }
        [TestMethod]
        public void TestMethod7()
        {
            int[] array = { 1 };
            int res = CountOccurances_.CountOccurances_.CountOccurances(1, array);
            Assert.AreEqual(array.Length, res);
        }
        [TestMethod]
        public void TestMethod8()
        {
            int[] array = { 0, 0, 0, 0, 0, -1, -6, -8, -10, 14, 6, 6, 6 };
            int res = CountOccurances_.CountOccurances_.CountOccurances(0, array);
            Assert.AreEqual(5, res);
        }
        [TestMethod]
        public void TestMethod9()
        {
            int[] array = { 1, 6, 3, 4, 3, 4 };
            int res = CountOccurances_.CountOccurances_.CountOccurances(3, array);
            Assert.AreEqual(2, res);
        }
        [TestMethod]
        public void TestMethod10()
        {
            int[] array = { 0, -6, -4, 4, -4, -4, 5, -4, 8, -4, -4, 12, 0, 0, -6, -4, -4, -4, -4, 5, -4, 8, -4, 12, 0, 0, -6, -4, 4, -4, -4, 5, -4, 8, -4, 12, 0, -4,};
            int res = CountOccurances_.CountOccurances_.CountOccurances(-4, array);
            Assert.AreEqual(18, res);
        }

    }
}
